//
//@File    :	5.10_equal.cpp
//@Time    :	2021/08/06 17:39:39
//@Auther  :	Sun Sheng
//@Contact :	970340843@qq.com
//@Desc    :	equality vs assignment
//

#include <iostream>

using namespace std;
int main()
{
    int quizscores[10] = {20,20,20,20,20,19,20,18,20,20};
    cout<<"Doing it right:\n";
    int i;
    for ( i = 0; quizscores[i] == 20; i++)
    {
        cout<<"quiz "<<i<<" is a 20\n";
    }
    cout<<"Doing it dangerously wrong:\n";
    for ( i = 0; quizscores[i] = 20; i++)
    //异常，quizescores[i] = 20,不是==
    {
        cout<<"quiz "<<i<<" is a 20\n";
    }
    system("pause");
    return 0;
}